package com.kaigejava.sortingalgorithm.insertionsorting;

import java.util.Arrays;

public class Changezero {
    public static void main(String[] args) {
        int[] arr =  {0,9,0,8,1,2,3,4};
        for (int i = 0; i < arr.length; i++) {
            if(arr[i] == 0){
                for (int j = arr.length-1; j>i; j--) {
                    arr[j] = arr[j-1];
                }
                if (i+1 < arr.length){
                    arr[i+1] = 0;
                    i++;
                }
            }
        }
        System.out.println(Arrays.toString(arr));
    }
}
